Endpoint: /analyze/<id>
Returns the found pairs of color and background color and calculated contrast values as well as proposals.
Request
URL
Method: GET
/api/analyze/<id>
Request Parameters
id: ID of the website (required)
Request Body
no request body
Response
Response Elements
id: ID of the requested websitepairs: list of pairspair.text: text content of pairpair.selector: unique generated selector for DOM element of pairpair.colorServer: resolved font color of pairpair.backgroundColorServer: resolved background color of pairpair.fontSizeServer: resolved font size of in pxpair.fontWeightServer: resolved font weightpair.wcag: calculated WCAG contrast of pairpair.apca: calculated APCA contrast of pairpair.colorHighestContrast: calculated color with highest contrastpair.backgroundColorHighestContrast: calculated background color with highest contrastpair.colorWcagAAAContrast: calculated color that most closely meets the WCAG AAA contrast standardpair.backgroundColorWcagAAAContrast: calculated background color that most closely meets the WCAG AAA contrast standardpair.colorApcaSmallbodytextContrast: calculated color that most closely meets the APCA small body text contrast standardpair.backgroundColorApcaSmallbodytextContrast: calculated background color that most closely meets the APCA small body text contrast standardpair.fontSizeHighestValue: calculated font size meeting highest requirements of APCA contrast standard in pxpair.fontWeightHighestValue: calculated font weight meeting highest requirements of APCA contrast standard
Examples
Request
GET /api/analyze/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-type: application/json
Response
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"pairs": [
{
"text": "This is a header",
"id": "body:nth-of-type(1) header:nth-of-type(1) h1:nth-of-type(1)",
"colorServer": "rgb(255, 255, 255)",
"backgroundColorServer": "rgb(0, 0, 0)"
},
{
"text": "This is a paragraph.",
// ...
},
// ...
]
}